package thread;

public class Damo6 {
    public static void main(String[] args) {
        //此处的lambda就是要代替刚才重写的run
        Thread t = new Thread(()->{
            while (true){
                System.out.println("Thread");
                try{
                    Thread.sleep(1000);
                }catch (InterruptedException e){
                    e.printStackTrace();//打印异常调用栈
                }
            }
        });
        t.start();

        while (true){
            System.out.println("main");
        }
    }
}
